import { Index, ViewColumn, ViewEntity } from 'typeorm';

@ViewEntity({
  name: 'sys_users_node_view',
  expression: `
    SELECT id, 
    username,
    nickname,
    realname,
    phone,
    deleted_at,
    created_at,
    updated_at
    FROM sys_users
  `,
})
export class SysUser {
  @Index('uid_index', { unique: true })
  @ViewColumn()
  id: string;

  @ViewColumn()
  /** 用户名 */
  username: string;

  @ViewColumn()
  /** 昵称 */
  nickname: string;

  @ViewColumn()
  /** 真实姓名 */
  realname: string;

  @ViewColumn()
  phone: string;
}
